//
//  MyUnitLessMoneyTableViewCell.m
//  PropertyManager
//
//  Created by TNG on 2018/7/30.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "MyUnitLessMoneyTableViewCell.h"

@implementation MyUnitLessMoneyTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
    }
    return self;
}

-(void)creatUI{
    [self.contentView addSubview:self.img];
    [self.contentView addSubview:self.moneyLabel];
}

-(void)send
{
    self.img.backgroundColor = SFMRandColor;
    self.moneyLabel.attributedText = [NSMutableAttributedString headStr:@"已缴纳押金总计：" AndMiddleStr:@"￥300" AndFootStr:@"，合同终止时将全额退还押金" AndFont:font(10) AndTextColor:SFMColor(254, 101, 54)];
}

-(void)sendMyUnitModel:(MyUnitModel *)model
{
    self.img.backgroundColor = SFMRandColor;
    self.moneyLabel.attributedText = [NSMutableAttributedString headStr:@"已缴纳押金总计：" AndMiddleStr:@"￥300" AndFootStr:@"，合同终止时将全额退还押金" AndFont:font(10) AndTextColor:SFMColor(254, 101, 54)];
}

-(UIImageView *)img
{
    if (_img == nil) {
        _img= [[UIImageView alloc] initWithFrame:CGRectMake(20, 11.5, 12, 12)];
        _img.contentMode = UIViewContentModeScaleAspectFill;
        _img.clipsToBounds = YES;
    }
    return _img;
}

-(UILabel *)moneyLabel
{
    if (_moneyLabel == nil) {
        _moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(43, 10, WIDTH - 53, 15)];
        _moneyLabel.font = font(10);
        _moneyLabel.textColor = SFM51;
        _moneyLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _moneyLabel;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
